package Solutions;

public class Solution7 {
    public static void main(String[] args) {
        String str="  Hello Azhen!   ";
        String trim = str.trim();
        int length=0;
        for (int i=trim.length()-1;i>=0;i--){
            if (trim.charAt(i)==' '){
                break;
            }else {
                length++;
            }
        }
        System.out.println(length);
    }
}
